package me.ingxin.android.badge

import android.view.View

/**
 * Created by ingxin on 2022/12/20
 * 红点类型角标
 */
class DotBadge private constructor(
    badgeDrawable: BadgeDrawable,
    anchor: View,
    gravity: Gravity
) : Badge(badgeDrawable, anchor, gravity) {

    class Builder : BadgeBuilder<Builder>() {

        private var radius = badgeDrawable.radius

        /**
         * 设置红点半径
         */
        fun setRadius(radius: Int):Builder {
            this.radius = radius
            return this
        }

        fun build(anchor: View): DotBadge {
            badgeDrawable.enableDot(radius)
            return DotBadge(badgeDrawable, anchor, gravity)
        }
    }

}



